home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
COMMUNIC
/
NETWORKI
/
0609.ZIP
/
DEXCARD2.BAS
< prev
next >
Wrap
BASIC Source File
|
1987-01-11
|
4KB
|
107 lines
5 'DEXCARD2.BAS : Sample General Roladex Card Print Program for DEX/NET
6 'Version 1.3
10 '
12 'Use the DEX/TRACT program to extract the ASCII information
13 'format (Selection F3 or 'A' in DEX/TRACT).
14 '
15 'Original Author : V. Godin / January 1987
16 '
17 'Modifications made for selections etc by K. Nickerson
18 'January 15th, 1987
100 '
102 '* Some Set-up Activity
103 '
105 ON ERROR GOTO 1000
110 WIDTH 80 : COLOR 7,8 : X = 1
120 CLS : KEY OFF : PRINT TAB(20);"DEX/TRACT SAMPLE ROLADEX CARD PRINT PROGRAM"
130 PRINT TAB(27);" Version 1.3 January 15th 1987"
160 PRINT : PRINT "Enter DEX/TRACT (A)scii Export "
170 INPUT "File Name ";A$
172 PRINT : INPUT "Enter Catagory to Print On ";X$
175 OPEN A$ FOR INPUT AS #2
177 LPRINT "DEXCARD2 Print Program for DEX/NET" : LPRINT
178 LPRINT "Search Catagory is : ";X$
179 Z = 2 : GOSUB 2000
180 '
181 '* Main program loop for DEXCARD2.BAS *'
182 '
183 '* Start by reading the whole 'record' into memory *'
184 '
185 INPUT #2,C$
186 IF EOF(2) THEN 275
187 INPUT #2,D$,E$,F$,G$,H$,I$,J$,K$,L$,M$,N$,O$,P$,Q$,R$,S$,T$
188 '
189 '* Check to see if either select key is equal to user supplied *'
190 '
191 '* Start by getting rid of trailing spaces for comparisson *'
192 '
197 B$ = N$ : GOSUB 700 : N$ = B$
198 B$ = O$ : GOSUB 700 : O$ = B$
199 '
200 IF X$ = "" THEN GOSUB 500 ELSE IF N$ = X$ THEN GOSUB 500 ELSE IF O$ = X$ THEN GOSUB 500
250 GOTO 185
270 '
271 '* All processing complete, close files and exit back to system *'
272 '
275 CLOSE #2
280 PRINT "End-of-Job" : BEEP : BEEP : BEEP : END
500 '
501 '* This section prints the record to the output device *'
502 '
503 '* This code was written 'this way' to be EASY as possible
504 '* to change, feel free to edit to meet your requirements!
505 '
506 '* The B$;" "; allows the next field to be on the current line *'
507 '* The 'ELSE LPRINT' makes sure that if the field is empty, *'
508 '* the following field will be printed in it's correct place. *'
509 '
510 Z = 1
520 B$ = C$ : GOSUB 700 : IF B$ <> "" THEN LPRINT "Name : ";B$;" ";: Z = Z + 1
522 B$ = D$ : GOSUB 700 : IF B$ <> "" THEN LPRINT B$ ELSE LPRINT : Z = Z + 1
524 B$ = E$ : GOSUB 700 : IF B$ <> "" THEN LPRINT "Company : ";B$ : Z = Z + 1
526 B$ = F$ : GOSUB 700 : IF B$ <> "" THEN LPRINT "Address : ";B$ : Z = Z + 1
528 B$ = G$ : GOSUB 700 : IF B$ <> "" THEN LPRINT " : ";B$;" "; : Z = Z + 1
530 B$ = H$ : GOSUB 700 : IF B$ <> "" THEN LPRINT B$ ELSE LPRINT : Z = Z + 1
532 B$ = I$ : GOSUB 700 : IF B$ <> "" THEN LPRINT "City : ";B$;" "; : Z = Z + 1
534 B$ = J$ : GOSUB 700 : IF B$ <> "" THEN LPRINT B$ ELSE LPRINT : Z = Z + 1
536 B$ = K$ : GOSUB 700 : IF B$ <> "" THEN LPRINT "Code : ";B$ : Z = Z + 1
538 B$ = L$ : GOSUB 700 : IF B$ <> "" THEN LPRINT "Phone 1 : ";B$ : Z = Z + 1
540 B$ = M$ : GOSUB 700 : IF B$ <> "" THEN LPRINT "Phone 2 : ";B$ : Z = Z + 1
542 B$ = N$ : GOSUB 700 : IF B$ <> "" THEN LPRINT "Catagory 1 : ";B$ : Z = Z + 1
544 B$ = O$ : GOSUB 700 : IF B$ <> "" THEN LPRINT "Catagory 2 : ";B$ : Z = Z + 1
546 B$ = P$ : GOSUB 700 : IF B$ <> "" THEN LPRINT "Date : ";B$ : Z = Z + 1
548 B$ = Q$ : GOSUB 700 : IF B$ <> "" THEN LPRINT "Time : ";B$ : Z = Z + 1
550 B$ = R$ : GOSUB 700 : IF B$ <> "" THEN LPRINT "Note 1 : ";B$ : Z = Z + 1
552 B$ = S$ : GOSUB 700 : IF B$ <> "" THEN LPRINT "Note 2 : ";B$ : Z = Z + 1
598 GOSUB 2000
599 RETURN
700 '
701 '* Erase Trailing Spaces in Input Field B$ *'
702 '
710 FOR L = LEN(B$) TO 1 STEP -1
720 IF MID$(B$,L,1) <> " " THEN 740
730 NEXT L : RETURN
740 B$ = LEFT$(B$,L): RETURN
1000 '
1001 '* Printer Error Recovery *'
1002 '
1010 IF ERR=24 THEN RESUME
1020 IF ERR <> 27 AND ERR <> 25 THEN 1100
1030 PRINT : BEEP : COLOR 25,7
1040 PRINT "Turn Printer On...";:COLOR 7,8
1050 PRINT : PRINT "Hit ANY Key to Continue"
1060 IF INKEY$="" THEN 1060 ELSE RESUME
1100 ON ERROR GOTO 0 : END
2000 '
2001 '* This sub-routine generates n blank lines to next form *'
2002 '
2004 ' To alter spaces between lables change line number 2020
2006 ' in the FOR loop which will 'count' this adjustment
2007 '
2020 FOR P = Z TO 20 :'<-- CHANGE THIS LINE FOR FORM SPACES
2030 LPRINT ' '
2040 NEXT P
2050 RETURN
9000 '
9001 '* End of Program